package com.xn.app.muying.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.xn.app.muying.R;
import com.xn.app.muying.util.BaseActivity;
import com.zhuge.analysis.stat.ZhugeSDK;

/**
 * 支付失败
 * Created by Administrator on 2016/12/2.
 */
public class PayFailActivity extends BaseActivity {
    //返回键
    private ImageView img_back = null;
    //标题
    private TextView title_name = null;
    //取消订单
    private TextView btn = null;
    //重新支付
    private TextView btn1 = null;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_payfail);
        btn = (TextView) findViewById(R.id.activity_payefail_btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        btn1 = (TextView) findViewById(R.id.activity_payefail_no);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                //判断返回页面
                //会员支付
                if(getIntent().getStringExtra("type").equals("vip")){
                    if (ReadyPayActivity.readyPayActivity != null) {
                        ReadyPayActivity.readyPayActivity.finish();
                    }
                    intent.setClass(PayFailActivity.this, VIPActivity.class);
                }
                //胎心监护
                if(getIntent().getStringExtra("type").equals("monitor")){
                    intent.setClass(PayFailActivity.this, MonitorSelectActivity.class);
                }
                startActivity(intent);
                finish();
            }
        });
        title_name = (TextView) findViewById(R.id.title_name);
        title_name.setText("支付失败");
        img_back = (ImageView) findViewById(R.id.img_back);
        img_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }

    @Override
    protected void onResume() {
        super.onResume();
    }
}
